import { IMP3Data } from "./useRequest";

/**
 * 获取 MP3 整体信息
 */
export function mp3DataOutline(data: IMP3Data[]) {
	const count = data.length;
	const itemCount = new Set(data.map(({ title }) => title)).size;
	const albumCount = new Set(data.map(({ album }) => album)).size;
	const artistCount = new Set(data.map(({ artist }) => artist)).size;

	return {
		count,
		itemCount,
		albumCount,
		artistCount,
	};
}
